package com.opo5.logisticsmanagement.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.opo5.logisticsmanagement.validationgroup.UpdateValida;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

/**
 * 
 * @TableName tbs_dict
 */
@TableName(value ="tbs_dict")
@Data
public class Dict implements Serializable {
    /**
     * 主键
     */
    @TableId(type = IdType.AUTO)
    @NotNull(groups = UpdateValida.class,message = "更新不能没有id")
    private Integer id;

    /**
     * 字典名称
     */
    @NotBlank(message = "字典名称不能为空")
    private String text;

    /**
     * 字典值
     */
    @NotBlank(message = "字典值不能为空")
    private String value;

    /**
     * 描述
     */
    private String expl;

    /**
     * 是否删除
     */
    @NotBlank(message = "状态不能为空")
    @Pattern(regexp ="^[01]$",message = "只能是0和1")
    private String status;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}